<template>
  <div class="box">
    <iframe id="mainIframe"
            ref="mainIframe"></iframe>
  </div>
</template>
<style scoped>
</style>
<script>
  export default {
    data () {
      return {

      }
    },
    props: {
      html: {
        type: String,
        default: ''
      }
    },
    watch: {
      html () {
        if (this.html) {
          let pDoc = this.$refs["mainIframe"].contentWindow.document;
          pDoc.body.innerHTML = this.html;
        }

      }
    },
    mounted () {


    }
  }
</script>

